package com.yzh.wanandroid.view

import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AlertDialog
import androidx.databinding.DataBindingUtil
import com.yzh.wanandroid.R
import com.yzh.wanandroid.databinding.LoadingProgressBinding


class LoadingDialog(context: Context) : AlertDialog(context) {

    private lateinit var dataBindingView: LoadingProgressBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        dataBindingView = DataBindingUtil.inflate(
            LayoutInflater.from(context),
            R.layout.loading_progress,
            null,
            false
        )
        val window = this.window
        window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        setContentView(dataBindingView.root)
        this.setCancelable(false)
    }
}